package com.ruoyi.rural.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rural.domain.RuralApplicationEpidemicPreventionMaterials;
import com.ruoyi.rural.mapper.RuralApplicationEpidemicPreventionMaterialsMapper;
import com.ruoyi.rural.service.IRuralApplicationEpidemicPreventionMaterialsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * 防疫物资申领Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-06
 */
@Service
public class RuralApplicationEpidemicPreventionMaterialsServiceImpl implements IRuralApplicationEpidemicPreventionMaterialsService 
{
    @Autowired
    private RuralApplicationEpidemicPreventionMaterialsMapper ruralApplicationEpidemicPreventionMaterialsMapper;

    /**
     * 查询防疫物资申领
     * 
     * @param id 防疫物资申领主键
     * @return 防疫物资申领
     */
    @Override
    public RuralApplicationEpidemicPreventionMaterials selectRuralApplicationEpidemicPreventionMaterialsById(String id)
    {
        return ruralApplicationEpidemicPreventionMaterialsMapper.selectRuralApplicationEpidemicPreventionMaterialsById(id);
    }

    /**
     * 查询防疫物资申领列表
     * 
     * @param ruralApplicationEpidemicPreventionMaterials 防疫物资申领
     * @return 防疫物资申领
     */
    @Override
    public List<RuralApplicationEpidemicPreventionMaterials> selectRuralApplicationEpidemicPreventionMaterialsList(RuralApplicationEpidemicPreventionMaterials ruralApplicationEpidemicPreventionMaterials)
    {
        return ruralApplicationEpidemicPreventionMaterialsMapper.selectRuralApplicationEpidemicPreventionMaterialsList(ruralApplicationEpidemicPreventionMaterials);
    }

    /**
     * 新增防疫物资申领
     * 
     * @param ruralApplicationEpidemicPreventionMaterials 防疫物资申领
     * @return 结果
     */
    @Override
    public int insertRuralApplicationEpidemicPreventionMaterials(RuralApplicationEpidemicPreventionMaterials ruralApplicationEpidemicPreventionMaterials)
    {
        ruralApplicationEpidemicPreventionMaterials.setId(UUID.randomUUID().toString());
        ruralApplicationEpidemicPreventionMaterials.setCreateTime(DateUtils.getNowDate());
        return ruralApplicationEpidemicPreventionMaterialsMapper.insertRuralApplicationEpidemicPreventionMaterials(ruralApplicationEpidemicPreventionMaterials);
    }

    /**
     * 修改防疫物资申领
     * 
     * @param ruralApplicationEpidemicPreventionMaterials 防疫物资申领
     * @return 结果
     */
    @Override
    public int updateRuralApplicationEpidemicPreventionMaterials(RuralApplicationEpidemicPreventionMaterials ruralApplicationEpidemicPreventionMaterials)
    {
        ruralApplicationEpidemicPreventionMaterials.setUpdateTime(DateUtils.getNowDate());
        return ruralApplicationEpidemicPreventionMaterialsMapper.updateRuralApplicationEpidemicPreventionMaterials(ruralApplicationEpidemicPreventionMaterials);
    }

    /**
     * 批量删除防疫物资申领
     * 
     * @param ids 需要删除的防疫物资申领主键
     * @return 结果
     */
    @Override
    public int deleteRuralApplicationEpidemicPreventionMaterialsByIds(String[] ids)
    {
        return ruralApplicationEpidemicPreventionMaterialsMapper.deleteRuralApplicationEpidemicPreventionMaterialsByIds(ids);
    }

    /**
     * 删除防疫物资申领信息
     * 
     * @param id 防疫物资申领主键
     * @return 结果
     */
    @Override
    public int deleteRuralApplicationEpidemicPreventionMaterialsById(String id)
    {
        return ruralApplicationEpidemicPreventionMaterialsMapper.deleteRuralApplicationEpidemicPreventionMaterialsById(id);
    }

    @Override
    public List<RuralApplicationEpidemicPreventionMaterials> selectRuralApplicationEpidemicPreventionMaterialsListByWeek(RuralApplicationEpidemicPreventionMaterials ruralApplicationEpidemicPreventionMaterials) {
        return ruralApplicationEpidemicPreventionMaterialsMapper.selectRuralApplicationEpidemicPreventionMaterialsListByWeek(ruralApplicationEpidemicPreventionMaterials);
    }
}
